package com.mlk.core.component.permission;

import com.mlk.core.util.SessionUtils;

/**
 * 个人数据权限的sql格式化器
 */
class PersonalDataPermissionSqlFormat extends DataPermissionSqlFormat {

    /**
     * 格式化sql的基本格式
     */
    public static final String SQL = "select *  from (  %s  ) trekxu  where  trekxu.create_id  =  %s ";

    @Override
    public String formatSql(String sourceSql) {
        return String.format(SQL,sourceSql, SessionUtils.getSysUser().getId());
    }
}
